package com.syz.mall.service;

import com.syz.mall.pojo.Product;
import com.syz.mall.pojo.User;
import com.syz.mall.pojo.UserAddress;
import com.syz.mall.pojo.UserOtherData;

import java.util.List;

public interface IUserService {
    User login(String username, String password);

    Boolean register(String username,String password);

    Boolean changePassword(Integer id,String newPassword);
    Boolean checkPassword(Integer id,String oldPassword);
    Boolean addAddress(UserAddress userAddress);
    Boolean deleteAddressById(Integer id);

    Boolean updateAddress(UserAddress userAddress);

    List<UserAddress> selectAllAddressByUserId(Integer userId);

    Boolean updateOtherDataSelective(UserOtherData userOtherData);

    Integer queryIdByUsername(String username);
    UserOtherData selectOtherDataByUserId(Integer userId);

    UserOtherData selectOtherDataByAnswer(Integer userId,String answer);

    Boolean collectProduct(Integer userId,Integer productId);

    Boolean checkIfCollect(Integer userId,Integer productId);

    Boolean cancelCollect(Integer userId,Integer productId);

    List<Product> selectUserCollect(Integer userId);
}
